import request from '@/utils/request';

export default {
  // 自动巡视 - 摄像机类型
  DeviceList(data) {
    return request({
      // url: "/inspect/pub/listByType",
      // method: "POST",
      // data
    });
  },
  // 自动巡视 - 摄像机类型
  DeviceNameData(data) {
    return request({
      // url: "/inspect/pub/listByType",
      // method: "POST",
      // data
    });
  },
  getStation() {
    return request({
      url: '/inspect/station/list?pageNum=1&pageSize=500',
      method: 'get'
    });
  },
  // 自动巡视 - 识别类型
  DiscernTypeSelect(data) {
    // return request({
    //   // url: "/inspect/pub/listByType",
    //   // method: "POST",
    //   // data
    // });
  },
  // 自动巡视 - 小类类型
  MinDeviceSelect() {
    return request({
      url: '/inspect/pub/type/min',
      method: 'POST'
    });
  },
  // 主动预警 - 状态量
  IndicatorList(data) {
    return request({
      url: '/aw/v1/comboBox/getIndicator',
      method: 'POST',
      data
    });
  },
  // 主动预警 - 预警级别
  ProcessingStrategy() {
    return request({
      url: '/aw/v1/comboBox/getStrategy',
      method: 'POST'
    });
  },
  // 主动预警 - 预警级别
  WarningLevel() {
    return request({
      url: '/aw/v1/comboBox/getWarningLevel',
      method: 'POST'
    });
  },
  // 危险点/案例库 - 流程控制
  FlowState() {
    return request({
      url: '/sc/seq/getDangerPointExeStatus/combobox',
      method: 'POST'
    });
  },
  // 故障处理 - 设备列表
  DevType() {
    return request({
      url: '/id/idPublicController/getDeviceIdList',
      method: 'POST'
    });
  },
  // 故障处理 - 获取状态量名称
  StatusName(data) {
    return request({
      url: '/id/idBreakdownStatus/queryList',
      method: 'POST',
      data
    });
  },
  // 故障处理
  CasesName(data) {
    return request({
      url: '/id/idFaultName/queryList',
      method: 'POST',
      data
    });
  },
  // 机器人装置类型下拉
  RobotDivice() {
    return request({
      url: '/autoinspect/ai/robot/tz/getRobotData',
      method: 'POST'
    });
  },
  // 小类设备分类
  minDeviceType() {
    return request({
      url: '/inspect/pub/type/min',
      method: 'POST'
    });
  },
  // 小类设备名称
  minDeviceName() {
    // return request({
    //   url: "/inspect/pub/type/allMin",
    //   method: "POST"
    // });
  },
  // 区域设备下拉
  getDeviceData(val) {
    return request({
      url: '/inspect/pub/dicts',
      method: 'POST',
      data: {
        stationId: val.stationId,
        intervalId: val.intervalId
      }
    });
  },
  // 间隔名称下拉
  getListArea(stationId) {
    return request({
      url: '/inspect/pub/intervalDicts',
      method: 'POST',
      params: {
        stationId
      }
    });
  },
  // 摄像机编号
  getVideoCode(id, provinceId) {
    return request({
      url: '/inspect/device/list/videoCode',
      method: 'POST',
      params: {
        id,
        provinceId
      }
    });
  },
  // 机器人编号
  getRobotNo() {
    return request({
      url: '/autoinspect/ai/robot/tz/getAllTZ',
      method: 'POST'
    });
  },
  // 机器人类型
  getRobotData() {
    return request({
      url: '/autoinspect/ai/robot/tz/getRobotData',
      method: 'POST'
    });
  },
  // 区域和设备维护的类型列表
  deviceTypeList() {
    return request({
      url: '/inspect/area/device/type/list',
      method: 'POST'
    });
  },
  // 字典的类型列表
  typeList() {
    return request({
      url: '/inspect/pub/type/list',
      method: 'POST'
    });
  },
  // 换流站
  listStation(voltageLevelId) {
    // return request({
    //   // url: "/autoinspect/ai/basic/pub/listStation2",
    //   // method: "POST",
    //   // data: {
    //   //   voltageLevelId,
    //   //   deptId: sessionStorage.getItem("ssbmid")
    //   // }
    // });
  },
  // 公共 - 部门/班组
  // OrgTreeByMenu (id) {
  //   return request({
  //     url: '/autoinspect/ai/basic/pub/listOrg',
  //     method: 'POST',
  //     data: {
  //       id
  //     }
  //   })
  // },
  //  公共 - 部门/班组
  OrgTreeByMenu(orgId) {
    return request({
      url: ' /inspect/checkPt/levelOrgTree',
      method: 'post',
      data: {
        nodeId: orgId
      }
    });
  },
  // 获取省公司、运维单位、部门班组
  childOrgList(data) {
    return request({
      url: '/system/isc_org/queryLowerLevelOrg',
      method: 'post',
      data
    });
  },
  // 公共 - 字典管理
  dict(id) {
    let ids = [];
    if (typeof id === 'string') {
      ids.push(id);
    } else {
      ids = id;
    }
    // return request({
    //   url: "/inspect/pub/listByType",
    //   method: "POST",
    //   data: {
    //     pubTypeList: ids
    //   }
    // });
  },
  // 站端数据同步
  getDeviceThird() {
    return request({
      url: '/auto-api-platfrom/inventory/synchronism',
      method: 'POST'
    });
  },
  // 同步按钮
  getThird(from) {
    return request({
      url: '/inspect/third/cmd',
      method: 'POST',
      data: {
        receiveCode: from.receiveCode,
        code: from.code,
        type: 61,
        command: from.command
      }
    });
  },
  // 机器人同步
  getRobotThird(from) {
    return request({
      url: '/host-access/sendMessage',
      method: 'POST',
      data: {
        receiveCode: from.receiveCode,
        code: from.code,
        type: 61,
        command: from.command
      }
    });
  },
  // 控制
  getReceive(url, form, password) {
    return request({
      url,
      method: 'POST',
      headers: {
        checkPassword: password
      },
      data: {
        type: form.type,
        command: form.command,
        stationCode: form.stationCode,
        patroldeviceCode: form.patroldeviceCode,
        value: form.value
      }
    });
  },
  geOpPermission(params) {
    return request({
      url: '/inspect/patrolDevice/get-op-permission',
      method: 'put',
      params
    });
  },
  geOpPermissionPut(data) {
    return request({
      url: '/inspect/patrolDevice/get-op-permission/put',
      method: 'post',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      data
    });
  },
  micrometeorology(deviceCode) {
    return request({
      url: `/communicator/runtime/micrometeorology/${deviceCode}`,
      method: 'get'
    });
  },
  patrolDeviceRealTimeData(deviceCode) {
    return request({
      url: `/communicator/runtime/patrolDeviceRealTimeData/${deviceCode}`,
      method: 'get'
    });
  },
  stationMap(stationCode) {
    return request({
      url: `/inspect/station/stationMap/${stationCode}`,
      method: 'get'
    });
  },
  patrolDeviceRoute(deviceCode) {
    return request({
      url: `/communicator/runtime/patrolDeviceRoute/${deviceCode}`,
      method: 'get'
    });
  },
  patrolDeviceCoordinate(deviceCode) {
    return request({
      url: `/communicator/runtime/patrolDeviceCoordinate/${deviceCode}`,
      method: 'get'
    });
  },
  patrolDeviceAlarm(patroldeviceCode) {
    return request({
      url: '/inspect/patrolDeviceAlarm/list',
      method: 'post',
      data: {
        confirmStatus: 0,
        patroldeviceCode
      }
    });
  },
  runtimeTaskStatus(params) {
    return request({
      url: `inspect/task-exec-statistics/executing-task`,
      method: 'get',
      params
    });
  },
  micrometeorologyByStation(stationCode) {
    return request({
      url: `/inspect/patrol-device-realtime-info/micrometeorologyData/${stationCode}`,
      method: 'get'
    });
  },
  // 判断是dev还是pro
  getDevAndPro() {
    return request({
      url: '/comm/get_environment',
      method: 'post'
    });
  },
  callData(data) {
    return request({
      url: '/inspect/inverse-linkage/callData',
      method: 'POST',
      data
    });
  }
};
